package 华为OD机试B卷复用题.基础题;

import utils.MyUtil;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class HJ44_相对开音节 {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner in = new Scanner(new File("src/main/java/华为OD机试B卷复用题/基础题/input/44.txt"));
        MyUtil.START();
        Solution(in);
        MyUtil.END();
    }

    static Set<Character> yuanyin =
            new HashSet<Character>() {
                {
                    add('a');
                    add('e');
                    add('i');
                    add('o');
                    add('u');
                }
            };
    static int result = 0;

    static void Solution(Scanner in) {
        String[] sArray = in.nextLine().split(" ");
        for (int i = 0; i < sArray.length; i++) {
            handle(sArray[i]);
        }
        System.out.println(result);
    }

    static void handle(String str) {
        boolean needReverse = true;
        int len = str.length();
        for (int i = 0; i < len; i++) {
            if (!Character.isLowerCase(str.charAt(i))) {
                needReverse = false;
                break;
            }
        }
        if (needReverse) {
            str = new StringBuilder(str).reverse().toString();
        }
        for (int i = 0; i < len - 3; i++) {
            char now = str.charAt(i);
            if (Character.isLowerCase(now) && !yuanyin.contains(now)) { // 找到第一个辅音
                char now_next_1 = str.charAt(i + 1);
                if (yuanyin.contains(now_next_1)) {
                    char now_next_2 = str.charAt(i + 2);
                    if (Character.isLowerCase(now_next_2)
                            && !yuanyin.contains(now_next_2)
                            && now_next_2 != 'r') {
                        char now_next_3 = str.charAt(i + 3);
                        if (now_next_3 == 'e') {
                            System.out.println(str.substring(i, i + 4));
                            result++;
                        }
                    }
                }
            }
        }
    }
}
